#!/bin/sh

  mkdir -p $HOME/.cache
  mkdir -p $HOME/.cache/winetricks
  cp -rf $PWD/winetricks_cache/* $HOME/.cache/winetricks

sudo mkdir -p /usr/share/wine
sudo mkdir -p /usr/share/wine/gecko
sudo cp -rf $PWD/winetricks_cache/gecko/* /usr/share/wine/gecko


cd "`dirname "$0"`"

winetrickslists=`cat $PWD/winetrickslist`

export PATH="$PWD/share:$PWD/wine_distrib/bin:$PATH"
LD_LIBRARY_PATH="$PWD/wine_distrib/lib:$PWD/wine_distrib/lib/wine:$LD_LIBRARY_PATH" WINEPREFIX="$PWD/wine_prefix" winetricks $winetrickslists &&

ln -s ../.. $PWD/wine_prefix/dosdevices/d: